-
-
Notifications
You must be signed in to change notification settings - Fork 228
Transformation function to turn FDEs into ODEs #3776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
test/fractional_to_ordinary.jl
Outdated
sys = fractional_to_ordinary(eqs, x, α, 10^-7, 1) | ||
|
||
prob = ODEProblem(sys, [], tspan) | ||
sol = solve(prob, radau5(), abstol = 1e-10, reltol = 1e-10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sol = solve(prob, radau5(), abstol = 1e-10, reltol = 1e-10) | |
sol = solve(prob, radau5(), saveat=time, abstol = 1e-10, reltol = 1e-10) |
rhs += value * t^(index - 1) / gamma(index) | ||
end | ||
for index in range(M, N-1; step=1) | ||
new_z = Symbol(:z, :_, i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a unicode piece so this doesn't clash with a user chosen name
``` | ||
""" | ||
function fractional_to_ordinary(eqs, variables, alphas, epsilon, T; initials = 0) | ||
@independent_variables t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just be the same as the main t
. @AayushSabharwal what's the quick way to check the eqs all match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That they have the same indepvar? check_equations(eqs, iv)
.
alpha_0 = α - m + 1 | ||
end | ||
|
||
δ = (gamma(alpha_0+1) * epsilon)^(1/alpha_0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gamma isn't defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gamma should be the gamma function from SpecialFunctions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 ahhh makes sense.
sol = solve(prob, radau5(), abstol = 1e-5, reltol = 1e-5) | ||
``` | ||
""" | ||
function linear_fractional_to_ordinary(degrees, coeffs, rhs, epsilon, T; initials = 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does this differ from just defining D.(u, alpha) ~ A*u
and calling the first one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is made for FDE with multiple fractional terms in a single equation, which the first one can't handle. On the other hand, this one doesn't work for non-linear DE.
Created a function for transformation addressed in #3707 using the methods described in https://arxiv.org/pdf/2506.04188.
Works for the first two examples of numerical experiments, but doesn't work for simple cases like x^2.